<template>
    <div>
        <div id="main6" style="width: 100%;height:17.5rem;position: absolute;left: 1.25rem;top: -1.25rem;margin: auto;"></div>
    </div>
</template>
  
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import * as echarts from 'echarts';
import { RequestStatisticGetPriceOfSettle } from "@/api/path/index.js";

// 基于准备好的dom，初始化echarts实例
// 绘制图表
onMounted(() => {
    RequestStatisticGetPriceOfSettle().then((res: any) => {
        var chartDom = document.getElementById('main6');
        var myChart = echarts.init(chartDom);
        var option;
        option = {
            color: ['#165eff'],
            xAxis: {
                type: 'category',
                data: res.resultObj.date
            },
            yAxis: {
                type: 'value'
            },
            series: [
                {
                    data: res.resultObj.price,
                    type: 'bar'
                }
            ]
        };

        option && myChart.setOption(option);
    })
})
</script>
<style lang="scss" scoped></style>